package org.ascollada.core
{
	public class DaeAnimationClip extends DaeElement
	{
		/** */
		public var start : Number;
		
		/** */
		public var end : Number;
		
		/** */
		public var animations : Array;
		
		/**
		 * 
		 */ 
		public function DaeAnimationClip(document:DaeDocument, element:XML=null)
		{
			super(document, element);
		}
		
		/**
		 * 
		 */ 
		public override function read(element:XML):void
		{
			super.read(element);
			
			this.animations = new Array();
			this.start = parseFloat(readAttribute(element, "start"));
			this.end = parseFloat(readAttribute(element, "end"));
			
			var children : XMLList = element.children();
			var child : XML;
			var num : int = children.length();
			var i : int;
			
			for(i = 0; i < num; i++)
			{
				child = children[i];
				
				switch(child.name().localName)
				{
					case "instance_animation":
						this.animations.push(readAttribute(child, "url", true));
						break;
						
					default:
						break;
				}
			}
		}
	}
}